class A implements Comparable<A> {
	private int value;
	public A(int value) {
		this.value=value;
	}

	public int compareTo(A o) {
		return value - o.value;
	}
}

class Test {
	public static void main(String[] args) {
		A a1=new A(10);
		Object a2=new A(20);
		System.out.println(a1.compareTo(a2));
		System.out.println(a2.compareTo(a1));
	}
}
